<template>
  <div>
    <el-pagination
      background
      layout="prev, pager, next"
      :total="total"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      hide-on-single-page
      :page-size="pageSize"
    ></el-pagination>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        total: 20,
        currentPage: 1,
        pageSize: 5
      };
    },
    methods: {
      handleCurrentChange(page) {
        console.log(page);
        this.currentPage = page;
      }
    }
  };
</script>

<style lang="less" scoped></style>
